<table class="common-table">
	<thead>
		<tr>
			<th>ID</th>
			<th>商品名称</th>
			<th>用户组</th>
			<th>价格</th>
			<th>权重</th>
			<th>状态</th>
			<th>操作</th>
			<th>删除</th>
		</tr>
	</thead>
	<tbody>
		#{if pricedCommodities}
			#{list items:pricedCommodities, as:'pricedCommodity'}
			<tr>
				<th>${pricedCommodity.id}</th>
				<td>${pricedCommodity.commodity.name}</td>
				<td><font class="important_2">${pricedCommodity.group.name}</font></td>
				<td><font class="important_1">${pricedCommodity.price} 元</font></td>
				<td>${pricedCommodity.group.priority}</td>
				<td>
					#{if pricedCommodity.status == models.BaseEntity.Status.ENABLE}
					<font class="important_2">可用</font>
					#{/if}
					#{if pricedCommodity.status == models.BaseEntity.Status.DISABLED}
					<font class="important_1">不可用</font>
					#{/if}
				</td>
				<td><a href="javascript:editPriceOpen('${pricedCommodity.commodity.id}', '${pricedCommodity.commodity.name}', '${pricedCommodity.group.id}', '${pricedCommodity.price}')" class="important_2">[修改]</a></td>
				<td>
					#{if pricedCommodity.status == models.BaseEntity.Status.ENABLE}
					<a href="javascript:updateStatus(${pricedCommodity.id}, 'DISABLED')" class="important_1">
					[禁用]
					</a>
					#{/if}
					#{if pricedCommodity.status == models.BaseEntity.Status.DISABLED}
					<a href="javascript:updateStatus(${pricedCommodity.id}, 'ENABLE')" class="important_2">
					[启用]
					</a>
					#{/if}
				</td>
			</tr>
			#{/list}
		#{/if}
		#{else}
		<tr>
			<td colspan="7">没找到结果。</td>
		</tr>
		#{/else}
	</tbody>
</table>
<div id="pager" style="font-size:1.3em;"></div>
<script language="javascript">
//初始化翻页控件。
function initialPager() {
	$("#pager").pager(
		{
			pagenumber: ${queryBean.currentPage}, 
			pagecount: ${queryBean.totalPage}, 
			totalcount: ${queryBean.totalQuantity},
			buttonClickCallback: PageClick
		}
	);
}
//翻页功能。
function PageClick(pageclickednumber) {
	$("#currentPage").val(pageclickednumber);
	reloadTable();
}
</script>